home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1282 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  976 b 

  1. Path: axe.netdoor.com!news
  2. From: esargent@netdoor.com (Eric Sargent)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: void pointers
  5. Date: Fri, 12 Jan 1996 20:46:39 GMT
  6. Organization: Internet Doorway, Inc.
  7. Message-ID: <4d6h8k$p6u@axe.netdoor.com>
  8. References: <1996Jan12.133322.1@ccc.govt.nz>
  9. NNTP-Posting-Host: port91.netdoor.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. mcauslanb@ccc.govt.nz wrote:
  13.  
  14. >I am writing a C program for an application that has a development language 
  15. >based on ANSI C.
  16.  
  17. >A function that I need to call is defined:
  18. >    void getFence (void **clipPP);
  19.  
  20. >   where "clipPP" is returned by the function.
  21.  
  22. >1) How do I declare and pass clipPP?
  23.  
  24. void (char, etc..)    *clipPP;
  25.  
  26. getFence(&clipPP);        (may need to be cast if not a void pointer)
  27.  
  28. >2) What is actually going on?
  29.  
  30. You are passing a pointer to a pointer to something.  Specific
  31. operations will affect clipPP in the calling program.  For example if
  32. getFence allocates ram for clipPP:
  33.  
  34. *clipPP = malloc(size);
  35.  
  36. Eric
  37.  
  38.  
  39.